home *** CD-ROM | disk | FTP | other *** search
/ PC Format (UK) 134 / PC Format DVD 2002.iso / Full / 3D Flash Animator / 3DFlashAnimator3Setup.exe / file0776_1ed679_1eda67.bin < prev    next >
Encoding:
Text File  |  2001-11-08  |  3.4 KB  |  107 lines

  1. <title>Library</title>
  2.  
  3. <script language="EasyScript">
  4.  
  5.     directory = getRegistryValue ("Library", "directory", "images");
  6.     sub_directory = getRegistryValue ("Library", "sub_directory", "computers");
  7.  
  8. /////////////////////////////////////
  9. function GetSubDirectories (directory)
  10. {
  11.     var buffer = "<select name='sub_directory' onChange='window.reparse()'>";
  12.     dir_path = getProgramDirectory() + "/library/" + directory + "/";
  13.     dir_array = getDirectoryList (dir_path + "*.");
  14.     dir_array.sortStrings();
  15.     for (n=0; n< dir_array.count; n++){
  16.         file_path = dir_path + dir_array[n] + "/";
  17.         file_array = getFileList (file_path + "*.*");
  18.         file_array.sortStrings();
  19.         buffer += "<option value='" + dir_array[n] + "'>";
  20.         buffer += dir_array[n];}
  21.     return buffer;
  22. }
  23. ////////////////////
  24. function GetImages ()
  25. {
  26.     if (sub_directory == "") return "";
  27.  
  28.     var buffer = "";
  29.     dir_path = getProgramDirectory() + "/library/images/";
  30.     file_path = dir_path + sub_directory + "/";
  31.     file_array = getFileList (file_path + "*.*");
  32.     file_array.sortStrings();
  33.     for (m=0; m< file_array.count; m++){
  34.         file_name = file_path + file_array[m];
  35.         buffer += "<img toolbutton src='" + file_name + "' ";
  36.         buffer += "onMouseUp=\"AddLibraryFile('" + file_name + "')\" title='" + file_array[m] + "'>";
  37.         buffer += "<spacer width=15>";}
  38.     return buffer;
  39. }
  40. ////////////////////
  41. function GetSounds ()
  42. {
  43.     var buffer = "";
  44.     file_path = getProgramDirectory() + "/library/sounds/";
  45.     file_array = getFileList (file_path + "*.*");
  46.     file_array.sortStrings();
  47.     for (m=0; m< file_array.count; m++){
  48.         file_name = file_path + file_array[m];
  49.         buffer += "<img button src='images/small_sound.bitmap' onMouseUp=\"AddLibraryFile('" + file_name + "')\" title='Add sound'>";
  50.         buffer += "<spacer width=8>";
  51.         buffer += file_array[m];
  52.         buffer += "<br>";}
  53.     return buffer;
  54. }
  55. /////////////////////////////////
  56. function AddLibraryFile (filename)
  57. {
  58.     setRegistryValue ("Library", "directory", directory);
  59.     setRegistryValue ("Library", "sub_directory", sub_directory);
  60.     new_object = fileLoad (filename);
  61.     window.returnValue (new_object);
  62.     window.close ();
  63. }
  64. ////////////////
  65. function Close ()
  66. {
  67.     setRegistryValue ("Library", "directory", directory);
  68.     setRegistryValue ("Library", "sub_directory", sub_directory);
  69.     window.close ();
  70. }
  71.  
  72. </script>
  73.  
  74. <body bgcolor="#FFFFFF" text="#000000" width=-100 height=400 background="backgrounds\whitegrain.gif" translate>
  75. <div valign=middle>
  76.  
  77. <img src='images/small_bullet_blue.bitmap'>Choose a category<spacer>
  78.  
  79. <select name="directory" onChange='window.reparse()'>
  80. <option value="images">images
  81. <option value="sounds">sounds
  82. </select>
  83.  
  84. <if value="directory=='images'">
  85. <include value="GetSubDirectories('images')">
  86. <p><img src='images/small_bullet_blue.bitmap'>Then click on the image that you want to add to your movie
  87. <p><include value="GetImages()">
  88. </if>
  89.  
  90. <if value="directory=='textures'">
  91. <include value="GetSubDirectories('textures')">
  92. <p><img src='images/small_bullet_blue.bitmap'>Then click on the image that you want to add to your movie
  93. <p><include value="GetImages()">
  94. </if>
  95.  
  96. <if value="directory=='sounds'">
  97. <p><ul><ul><include value="GetSounds()"></ul></ul>
  98. </if>
  99. <p>
  100.  
  101. <table cellspacing=0 cellpadding=0 width="100%">
  102. <tr><td align=right>
  103. <a button onMouseUp="Close()" width=+20 height=+2><img src="images/small_cancel.bitmap" hspace=4>Cancel</a>
  104. </table>
  105.  
  106. <spacer height=4>
  107.